package javabase.schoolwork.day6_6;

/**
 * @author fance
 * @date 18-6-6 下午3:24
 */
class InfoIV<T> {
    private T var;

    public InfoIV(T var) {
        this.var = var;
    }

    public T getVar() {
        return var;
    }

    public void setVar(T var) {
        this.var = var;
    }

    @Override
    public String toString() {
        return "InfoIV{" +
                "var=" + var +
                '}';
    }
}
public class GenDemo10 {
    public static void main(String[] args) {
        InfoIV<String> i1 = new InfoIV<String>("李小龙");
        InfoIV<String> i2 = new InfoIV<String>("hello");
        add(i1,i2);
    }
    public static <T> void add(InfoIV<T> i1,InfoIV<T> i2) {
        System.out.println(i1.getVar() + " " + i2.getVar());
    }
}
